.Dd February 28, 2019
.Dt libcfile 3
.Os libcfile
.Sh NAME
.Nm libcfile.h
.Nd Library to support cross-platform C file functions
.Sh SYNOPSIS
.In libcfile.h
.Pp
Support functions
.Ft const char *
.Fn libcfile_get_version "void"
.Ft int
.Fn libcfile_get_codepage "int *codepage" "libcfile_error_t **error"
.Ft int
.Fn libcfile_set_codepage "int codepage" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_exists "const char *filename" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_remove "const char *filename" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_remove_with_error_code "const char *filename" "uint32_t *error_code" "libcfile_error_t **error"
.Pp
Available when compiled with wide character string support:
.Ft int
.Fn libcfile_file_exists_wide "const wchar_t *filename" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_remove_wide "const wchar_t *filename" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_remove_wide_with_error_code "const wchar_t *filename" "uint32_t *error_code" "libcfile_error_t **error"
.Pp
Notify functions
.Ft void
.Fn libcfile_notify_set_verbose "int verbose"
.Ft int
.Fn libcfile_notify_set_stream "FILE *stream" "libcfile_error_t **error"
.Ft int
.Fn libcfile_notify_stream_open "const char *filename" "libcfile_error_t **error"
.Ft int
.Fn libcfile_notify_stream_close "libcfile_error_t **error"
.Pp
Error functions
.Ft void
.Fn libcfile_error_free "libcfile_error_t **error"
.Ft int
.Fn libcfile_error_fprint "libcfile_error_t *error" "FILE *stream"
.Ft int
.Fn libcfile_error_sprint "libcfile_error_t *error" "char *string" "size_t size"
.Ft int
.Fn libcfile_error_backtrace_fprint "libcfile_error_t *error" "FILE *stream"
.Ft int
.Fn libcfile_error_backtrace_sprint "libcfile_error_t *error" "char *string" "size_t size"
.Pp
File functions
.Ft int
.Fn libcfile_file_initialize "libcfile_file_t **file" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_free "libcfile_file_t **file" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_open "libcfile_file_t *file" "const char *filename" "int access_flags" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_open_with_error_code "libcfile_file_t *file" "const char *filename" "int access_flags" "uint32_t *error_code" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_close "libcfile_file_t *file" "libcfile_error_t **error"
.Ft ssize_t
.Fn libcfile_file_read_buffer "libcfile_file_t *file" "uint8_t *buffer" "size_t size" "libcfile_error_t **error"
.Ft ssize_t
.Fn libcfile_file_read_buffer_with_error_code "libcfile_file_t *file" "uint8_t *buffer" "size_t size" "uint32_t *error_code" "libcfile_error_t **error"
.Ft ssize_t
.Fn libcfile_file_write_buffer "libcfile_file_t *file" "const uint8_t *buffer" "size_t size" "libcfile_error_t **error"
.Ft ssize_t
.Fn libcfile_file_write_buffer_with_error_code "libcfile_file_t *file" "const uint8_t *buffer" "size_t size" "uint32_t *error_code" "libcfile_error_t **error"
.Ft off64_t
.Fn libcfile_file_seek_offset "libcfile_file_t *file" "off64_t offset" "int whence" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_resize "libcfile_file_t *file" "size64_t size" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_is_open "libcfile_file_t *file" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_get_offset "libcfile_file_t *file" "off64_t *offset" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_get_size "libcfile_file_t *file" "size64_t *size" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_is_device "libcfile_file_t *file" "libcfile_error_t **error"
.Ft ssize_t
.Fn libcfile_file_io_control_read "libcfile_file_t *file" "uint32_t control_code" "uint8_t *control_data" "size_t control_data_size" "uint8_t *data" "size_t data_size" "libcfile_error_t **error"
.Ft ssize_t
.Fn libcfile_file_io_control_read_with_error_code "libcfile_file_t *file" "uint32_t control_code" "uint8_t *control_data" "size_t control_data_size" "uint8_t *data" "size_t data_size" "uint32_t *error_code" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_set_access_behavior "libcfile_file_t *file" "int access_behavior" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_set_block_size "libcfile_file_t *file" "size_t block_size" "libcfile_error_t **error"
.Pp
Available when compiled with wide character string support:
.Ft int
.Fn libcfile_file_open_wide "libcfile_file_t *file" "const wchar_t *filename" "int access_flags" "libcfile_error_t **error"
.Ft int
.Fn libcfile_file_open_wide_with_error_code "libcfile_file_t *file" "const wchar_t *filename" "int access_flags" "uint32_t *error_code" "libcfile_error_t **error"
.Sh DESCRIPTION
The
.Fn libcfile_get_version
function is used to retrieve the library version.
.Sh RETURN VALUES
Most of the functions return NULL or \-1 on error, dependent on the return type.
For the actual return values see "libcfile.h".
.Sh ENVIRONMENT
None
.Sh FILES
None
.Sh NOTES
libcfile can be compiled with wide character support (wchar_t).
.sp
To compile libcfile with wide character support use:
.Ar ./configure --enable-wide-character-type=yes
 or define:
.Ar _UNICODE
 or
.Ar UNICODE
 during compilation.
.sp
.Ar LIBCFILE_WIDE_CHARACTER_TYPE
 in libcfile/features.h can be used to determine if libcfile was compiled with wide character support.
.Sh BUGS
Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libcfile/issues
.Sh AUTHOR
These man pages are generated from "libcfile.h".
.Sh COPYRIGHT
Copyright (C) 2008-2024, Joachim Metz <joachim.metz@gmail.com>.
.sp
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.Sh SEE ALSO
the libcfile.h include file
